
public class Bicycle implements Cloneable{
	private int gear;
	private int cadence;
	private int speed;
	MountainBike bb=null;
		private int k=0;
  	public Bicycle(){
	}
  	public Bicycle(int gear,int cadence,int speed){
		this.gear=gear;
		this.cadence=cadence;
		this.speed=speed;
	  }

	public void Setup(int i,int j,int k){
		this.gear=i;
		this.cadence=j;
		this.speed=k;
	}
	public void SetupMountainBike(MountainBike b){
		this.bb=b;
	}
	public MountainBike GetMountainBike(){
		return this.bb;
	}

	public void printDescription(){

 		System.out.println("gear:" + this.gear + " cadence:" + this.cadence + " speed:" + this.speed+" rotate:"+this.bb.Getvaule()+"\n");
		
	}


   	public Object clone() throws CloneNotSupportedException {
		Bicycle ccc=(Bicycle)super.clone();

		if(bb!=null){
			MountainBike newbb=(MountainBike)bb.clone();
			ccc.SetupMountainBike(newbb);
		}
       		return ccc;
    	}

	public boolean equals(Bicycle obj){

		if(obj instanceof Bicycle){
			
			if(obj.gear==this.gear){
				System.out.println("gear=="+this.gear+"=="+obj.gear);
			}
			else{
				System.out.println("gear!="+this.gear+"!="+obj.gear);
				k++;
			}

			if(obj.cadence==this.cadence){
				System.out.println("cadence=="+this.cadence+"=="+obj.cadence);
			}
			else{
				System.out.println("cadence!="+this.cadence+"!="+obj.cadence);
				k++;
			}

			if(obj.speed==this.speed){
				System.out.println("speed=="+this.speed+"=="+obj.speed);
			}
			else{
				System.out.println("speed!="+this.speed+"1="+obj.speed);
				k++;
			}

			if(obj.bb.equals(this.bb)){
			//	System.out.println("bb==");
			}
			else{
			//	System.out.println("bb!=");
				k++;
			}

			if(k!=0)
				return false;
			else
				return true; 
		}
	        else
        		return false;
	}

}
